<?php
	header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/png" href="<?= base_url() ?>assets/melamud/img/favicon.png" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Melamud Propiedades - desde 1947 - Bienvenidos</title>

<link href="<?= base_url() ?>assets/melamud/css/estilos.css" rel="stylesheet" type="text/css" />

<? if ($esHome==1) { ?>
	<link href="<?= base_url() ?>assets/melamud/css/estiloImagenHome.css" rel="stylesheet" type="text/css" />
<? }else { ?>
	<link href="<?= base_url() ?>assets/melamud/css/estiloImagen.css" rel="stylesheet" type="text/css" />
<? } ?>
	
<link href="<?= base_url() ?>assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />


<script src="<?= base_url() ?>assets/kendo/js/jquery.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

<link href="<?= base_url() ?>assets/kendo/css/kendo.common.min.css" rel="stylesheet">
<link href="<?= base_url() ?>assets/kendo/css/kendo.default.min.css" rel="stylesheet">


<script src="<?= base_url() ?>assets/kendo/js/kendo.web.min.js"></script>



<script type="text/javascript" src="<?= base_url() ?>assets/melamud/js/jquery.timers-1.2.js"></script>
<script type="text/javascript" src="<?= base_url() ?>assets/melamud/js/jquery.easing.1.3.js"></script>

<!-- Third, add the GalleryView Javascript and CSS files -->
<script type="text/javascript" src="<?= base_url() ?>assets/melamud/js/jquery.galleryview-3.0-dev.js"></script>
<link type="text/css" rel="stylesheet" href="<?= base_url() ?>assets/melamud/css/jquery.galleryview-3.0-dev.css" />

<script>
/*
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-41417065-3', 'melamudpropiedades.com');
  ga('send', 'pageview');
*/
</script>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 
  ga('create', 'UA-48673725-1', 'melamudpropiedades.com');
  ga('send', 'pageview');
 
</script>
<script>
	var run;
	$(document).ready(function() {
		$("#selOperacion").kendoDropDownList();
		$("#selTipoPropiedad").kendoDropDownList();
		$("#field-idZona").kendoDropDownList();
		$("#selDormitorio").kendoDropDownList();
		//$('#field-idZona').change();
		$('#barrio').hide();
		
		$('#field-idZona').change(function() {
			if ($('#field-idZona').val()==0) {
				$('#barrio').hide();
			}else {
				$('#barrio').show();
				cargarBarriosLocalidades();
			}
		});
		
		$("#selOperacion").change(function() {
				if ($("#selOperacion").val() == 1){
					$("#radioPeso").attr("checked", true);
					//alert("a");
				}
		});
		
		cargarImagenesHead();
		
		$( "#dialog-form" ).dialog({
			  position:{ my: "top", at: "top", of: window },
			  autoOpen: false,
			  height: 450,
			  width: 600,
			  modal: true,
			  buttons: {
				"Aceptar": function() {
					var bValid = true;
					//allFields.removeClass( "ui-state-error" );
					$( this ).dialog( "close" );

				},
				Cancel: function() {
				  $( this ).dialog( "close" );
				}
			  },
			  close: function() {
				//allFields.val( "" ).removeClass( "ui-state-error" );
			}
		});
		
		$( "#imgBarrio" )
			.button()
				.click(function() {
					$( "#dialog-form" ).dialog( "open" );
		});
		
	});
	
	function cargarBarriosLocalidades() {
		if ($('#field-zona').val() != ""){
			$.ajax({
				type:'POST',
				url:'<?php echo base_url(); ?>index.php/propiedades/getBarriosLocalidades',                    
				dataType:'json',
				data:{idZona: $('#field-idZona').val()},                    
				cache:false,
				success:function(aData){ 
					$("#divBarrios").empty();
					var tipo;
					$.each(aData, function(idCounter,item) {
						$("#divBarrios").append ( "<label class='" + "columna_izquierda" + "' for='chk_" + idCounter + "'><input id='chk_" + idCounter + "' class='radio-uniform' type='checkbox' value='" + item.id + "' name='barrios[]' />  " + item.desc + "</label>" );
						tipo = item.tipo;
					});
					$('.validateTips').empty();
					$('.validateTips').append('Localidad/Partido');
					$('#tipoLugar').val(tipo);
				},
				error:function(){alert("Connection Is Not Available");}
			});

			return false;
		}
	}
	
	function cargarImagenesHead() {
		$.ajax({
			type:'POST',
			url:'<?php echo base_url(); ?>index.php/portada/getFotosHead/<?php echo $esHome ?>',                    
			dataType:'json',            
			cache:true,
			success:function(aData){ 
				 //alert(aData);
				$.each(aData, function(count,itemFoto) {
					$("#imagenFondo").append("<img height='500px' width='1600px' duracion='4000' src='" + itemFoto.path + "' />");
				});
				switchSlide();
			},
			error:function(){alert("Connection Is Not Available");}
		});

		return false;
	}
	
	function nextSlide() {
		$('#imagenFondo img:first').appendTo('#imagenFondo');
		$('#imagenFondo img:last').fadeIn(800, 'swing', function() {
			$('#imagenFondo img:last').prev().hide();
			speed = $(this).attr("duracion");
			window.clearInterval(run)
			run = setInterval("switchSlide()", speed);
		});
	}

	function switchSlide()
	{
		nextSlide();
	}

	function concatenerBarrios(){
		strBarrios="";
		$('input[type=checkbox]').each(function () {
			var sThisVal = (this.checked ? "1" : "0");
			if (sThisVal =="1")
				strBarrios += this.value + ",";
		});
		//alert(strBarrios);
		$("#strBarrios").val(strBarrios);
		
		
	}
	
/*	
	$(function(){
		$('#myGallery').galleryView({
			 panel_width: 740,
			 panel_height: 430,
			 show_filmstrip_nav: false,
		});
	});
*/
</script>
</head>

<body>
<?php echo form_open( "propiedades/buscar", 'method="post" id="formHead" autocomplete="off" enctype="multipart/form-data"'); ?>
	<input type="hidden" id="linkActual" value="<? echo current_url() ?>" name="linkActual" />
	<div class="" id="header">
		<div id="imagenFondoAbsoluto"> 
			<div id="imagenFondo"> 
				
			</div>			
		</div>
			<div id="logo">
				<a href="<?= base_url() ?>index.php"><img src="<?= base_url() ?>assets/melamud/img/logocabezal.png" /></a>
			</div>
			<div id="pielogo"> 
				<img src="<?= base_url() ?>assets/melamud/img/pielogo.png" />
			</div>
			<div id="buscador"> 
				<div id="operacion"> 
					<select id="selOperacion" name="operacion" style="width:110px">
						<option value="">Operacion</option>
						<option <? if ($this->input->post('operacion')==2) echo "selected=selected" ?> value='2'>Venta</option>
						<option <? if ($this->input->post('operacion')==1) echo "selected=selected" ?> value='1'>Alquiler</option>
					</select>
					<!--<img src="<?= base_url() ?>assets/melamud/img/operacion.png" /> -->
				</div>
				<div id="tipodepropiedad"> 
					<select id="selTipoPropiedad" name="tipoPropiedad" style="width:155px">
						<option value="">Tipo de Propiedad</option>
						  <?
							foreach ($tipospropiedad as $val){
						  ?>	
							<option <? if ($this->input->post('tipoPropiedad')==$val->idTipo) echo "selected=selected" ?>  value="<?=$val->idTipo?>"><?=$val->descripcion?></option>
						  <?
							}
						  ?>
					</select>
					<!--<img src="<?= base_url() ?>assets/melamud/img/tipodepropiedad.png" />-->
				</div>
				<div id="zonageografica"> 
					<select id="field-idZona" name="zona" style="width:135px">
						<option  value="">Zona geografica</option>
						  <?
							foreach ($zonas as $val){
						  ?>
							<option <? if ($this->input->post('zona')==$val->idZona) echo "selected=selected" ?> value="<?=$val->idZona?>"><?=$val->descripcion?></option>
						  <?
							}
						  ?>
					</select>
					<!--<img src="<?= base_url() ?>assets/melamud/img/zonageografica.png" />-->
				</div>
				<div id="barrio"> 
					<img id="imgBarrio" src="<?= base_url() ?>assets/melamud/img/barrio.png" />
				</div>
				<div id="dormitorios"> 
					<select id="selDormitorio" name="cantDormitorios" style="width:175px">
						<option value="">Dormitorios</option>
						<option value="0">Monoambientes</option>
						<option value="1">1 Dormitorio</option>
						<option value="2">2 Dormitorios</option>
						<option value="2">2 Dormitorios + dep.</option>
						<option value="3">3 Dormitorios</option>
						<option value="3">3 Dormitorios + dep.</option>
						<option value="4">4 Dormitorios</option>
						<option value="99">5 o mas</option>
					</select>
					<!--<img src="<?= base_url() ?>assets/melamud/img/dormitorios.png" />-->
				</div>
				<div id="dolaresypesos"> 
					<input style="float:left;margin-top:13px;margin-right:5px" id="radioDolar" name="moneda" type="radio" <? if (!isset($moneda) || $moneda==null || $moneda == "dolar") echo "checked='checked'"?> value="dolar" />
					<strong class="signoPrecio">U$S </strong>
					<input style="float:left;margin-top:13px;margin-left:8px;margin-right:5px" id="radioPeso" name="moneda" type="radio" <? if (isset($moneda) && $moneda == "peso") echo "checked='checked'" ?>  value="peso" />
					<strong class="signoPrecio">$</strong>
				</div>
				<div id="botonbuscar"> 
					<a href="javascript:concatenerBarrios(); $('#formHead').submit()"><img src="<?= base_url() ?>assets/melamud/img/botonbuscar.png" /></a>
				</div>
			</div>
	</div>
	<div id="menu">
	  <table width="889" border="0" align="center" class="textomenu" cellpadding="0" cellspacing="0">
		<tr>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php"><img id="botonhome" src="<?= base_url() ?>assets/melamud/img/botonhome.png" alt="" width="30" height="23" /></a></td>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php">HOME</a></td>
		  <td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php/principal/empresa">LA EMPRESA</a></td>
		  <td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php/propiedades/buscar/2">VENTAS</a></td>
		  <td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php/propiedades/buscar/1">ALQUILERES</a></td>
		  <td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php/principal/emprendimientos">EMPRENDIMIENTOS</a></td>
		  <td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php/principal/servicios">SERVICIOS</a></td>
		  <td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php/principal/newsletter">NEWSLETTER</a></td>
		  <td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
		  <td align="center" valign="middle"><a href="<?= base_url() ?>index.php/principal/contacto">CONTACTO</a></td>
		</tr>
	  </table>
	</div>
	<input id='tipoLugar' name='tipoLugar' type='hidden' value='' />
		<div id="dialog-form" title="Seleccionar">
			<p class="validateTips">Barrios</p>
			<fieldset>
				<div id="divBarrios">
				</div>
			</fieldset>
		</div>
	<div id="contenedor"> 
	<input id='strBarrios' name='strBarrios' type='hidden' value='' />	
		
		<?php echo $out; ?>
			
		
	</div>
	<?php echo form_close(); ?>
	<div id="edificios">
		<div id="edificios-contenedor">
			<div id="edificiosIzq">
				<table width="650" border="0" align="center" class="tablaFooter" cellpadding="0" cellspacing="0">
					<tr>
						<td align="center" valign="middle">EMPRENDIMIENTOS</td>
						<td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
						<td align="center" valign="middle">TASACIONES</td>
						<td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
						<td align="center" valign="middle"><a class="" href="javascript:filtrar('filtro-tipoPropiedad',2,'Casa');">CASAS</a></td>
						<td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
						<td align="center" valign="middle"><a class="" href="javascript:filtrar('filtro-tipoPropiedad',1,'Departamento');">DEPARTAMENTOS</a></td>
						<td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
						<td align="center" valign="middle"><a class="" href="javascript:filtrar('filtro-tipoPropiedad',3,'PH');">PH</a></td>
						<td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
						<td align="center" valign="middle"><a class="" href="javascript:filtrar('filtro-tipoPropiedad',6,'Oficina');">OFICINAS</a></td>
						<td align="center" valign="middle"><img src="<?= base_url() ?>assets/melamud/img/divisoria.png" alt="" width="3" height="20" /></td>
						<td align="center" valign="middle"><a class="" href="javascript:filtrar('filtro-tipoPropiedad',5,'Local');">LOCALES COMERCIALES</a></td>
					</tr>
				</table>
			</div>
			<div id="edificiosDer">
				<table  class="tablaFooter" width="300" border="0">
					<tr>
						<td width="100" class="textopie">Seguinos en:</td>
						<td>
							<img src="<?= base_url() ?>assets/melamud/img/logosredes.png" alt="" width="186" height="38" border="0" usemap="#Map" />
							<map name="Map" id="Map">
								<area shape="rect" coords="-3,3,34,34" href="https://twitter.com/melamudprop" target="_blank" />
								<area shape="rect" coords="42,2,73,41" href="https://www.facebook.com/pages/Melamud-Propiedades/137307192997399?fref=ts" target="_blank" />
								<area shape="rect" coords="79,2,112,36" href="#" />
								<area shape="rect" coords="117,3,148,42" href="#" />
								<area shape="rect" coords="156,3,208,52" href="http://propiedades.zonaprop.com.ar/inmobiliaria-melamud-propiedades/uiZ7035151_formatZlist" target="_blank" />
							</map>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<div id="footer">
		<div class="contenedor-footer">
			<table width="1024" border="0" class="contenedor-footer" align="center">
			  <tr>
				<td width="247" align="left">
					<img src="<?= base_url() ?>assets/melamud/img/logo.png" width="205" height="60" />
				</td>
				<td align="center">
					La Pampa 1517 3&deg;C, Edificio Bureau Libertador, Belgrano
				</td>
				<td align="right" width="210">
					<span class="telefono-footer">4784.7884 / 4780.3709<span>
				</td>
			  </tr>
			</table>
		</div>
	</div>
</body>
</html>